﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLBH.Model.Controller;
using QLBH.DataModel;
using QLBH.ModelInterface;

namespace QLBH.SaleProduct.Presenter
{
    class QLPhieuMuaHangPresenter
    {
        /// <summary>
        /// Get All Phieu Mua hang 
        /// </summary>
        /// <returns></returns>
        public List<IPhieuMuaHangModel>GetAllPhieuMuaHang()
        {
            List<IPhieuMuaHangModel> list = new List<IPhieuMuaHangModel>();
            var model = PhieuMuaHangController.GetInstance().GetAll();
            foreach (PHIEUMUAHANG p in model)
            {
                IPhieuMuaHangModel mp = ModelFactory.ModelFactory.GetPhieuMuaHangModelInstance();
                mp.InitFromEntity(p);
                list.Add(mp);
            }
            return list;
        }
    }
}
